package com.haiheng.module_main.fragment.bookcar

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.core.os.bundleOf
import com.haiheng.common.constant.AppConstant
import com.haiheng.common.constant.AppConstant.Companion.SP_USER_LOGIN
import com.haiheng.common.constant.Keys
import com.haiheng.common.constant.RourePage
import com.haiheng.common.fragment.RouterFragment
import com.haiheng.library_base.model.BaseViewModel
import com.haiheng.library_base.utils.SPUtils
import com.haiheng.module_main.databinding.FragmentLoginResultBinding

/**
 *
 * @Des:
 * @Author: hwz
 * @Date:2024/8/16 0016
 * @Version: 1.0
 */
class LoginResultFragment:RouterFragment() {
    private lateinit var binding:FragmentLoginResultBinding

    override fun onCreateView(
        inflater: LayoutInflater,
        container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        binding = FragmentLoginResultBinding.inflate(inflater,container,false)
        return binding.root
    }
    override fun initView() {
        var userlOgin = SPUtils.getInstance().getString(SP_USER_LOGIN)
        binding.tvLoginAcount.setText(userlOgin)
        binding.sllExitLogin.setOnClickListener {
            SPUtils.getInstance().put(AppConstant.SP_TOKEN,"")
            SPUtils.getInstance().put(SP_USER_LOGIN,"")
            activity.navigation(RourePage.LOGIN)
        }
        binding.llBookShelf.setOnClickListener {
            activity.navigation(RourePage.BOOK_CAR_INFO, bundleOf(Keys.PAGE_TYPE to RourePage.BOOK_CAR_SHELF))

        }
        binding.llBookScan.setOnClickListener {
            activity.navigation(RourePage.BOOK_CAR_INFO, bundleOf(Keys.PAGE_TYPE to RourePage.BOOK_CAR_SCAN))

        }
        binding.llBookPositioning.setOnClickListener {
            activity.navigation(RourePage.BOOK_CAR_WEB)
        }
        binding.llBookDeliveryOrder.setOnClickListener {
            activity.navigation(RourePage.BOOK_CAR_BOOK_DELIVER_ORDER)
        }
    }

    override fun initViewModel(): BaseViewModel? {
       return null
    }

    override fun initLoad() {

    }
}